package cn.dujc.superkid.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * @author du
 * date 2018/8/4 下午12:21
 */
public class ExamineListResult implements Parcelable{
    /**
     * id : 1
     * gname : 一年级
     * sorting : 10
     * exList : [{"id":161,"ex_title":"11月份月考（2017年）","addtime":1512004030,"latest":2}]
     */

    private String id;//年级id
    private String gname;//年级名
    private String sorting;//排序
    private List<ExListEntity> examine_list;//考试试卷列表

    public String getId() { return id;}

    public void setId(String id) { this.id = id;}

    public String getGname() { return gname;}

    public void setGname(String gname) { this.gname = gname;}

    public String getSorting() { return sorting;}

    public void setSorting(String sorting) { this.sorting = sorting;}

    public List<ExListEntity> getExamine_list() {
        return examine_list;
    }

    public void setExamine_list(List<ExListEntity> examine_list) {
        this.examine_list = examine_list;
    }

    public static class ExListEntity implements Parcelable{
        /**
         * id : 161
         * ex_title : 11月份月考（2017年）
         * addtime : 1512004030
         * latest : 2
         */

        private String id;//知识点id
        private String ex_title;//试卷标题
        private String addtime;//试卷添加时间戳
        private String latest;//是否是最新（1-不是，2-是最新）

        public String getId() { return id;}

        public void setId(String id) { this.id = id;}

        public String getEx_title() { return ex_title;}

        public void setEx_title(String ex_title) { this.ex_title = ex_title;}

        public String getAddtime() { return addtime;}

        public void setAddtime(String addtime) { this.addtime = addtime;}

        public String getLatest() { return latest;}

        public void setLatest(String latest) { this.latest = latest;}

        @Override
        public int describeContents() { return 0; }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.ex_title);
            dest.writeString(this.addtime);
            dest.writeString(this.latest);
        }

        public ExListEntity() {}

        protected ExListEntity(Parcel in) {
            this.id = in.readString();
            this.ex_title = in.readString();
            this.addtime = in.readString();
            this.latest = in.readString();
        }

        public static final Creator<ExListEntity> CREATOR = new Creator<ExListEntity>() {
            @Override
            public ExListEntity createFromParcel(Parcel source) {return new ExListEntity(source);}

            @Override
            public ExListEntity[] newArray(int size) {return new ExListEntity[size];}
        };
    }

    @Override
    public int describeContents() { return 0; }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.gname);
        dest.writeString(this.sorting);
        dest.writeTypedList(this.examine_list);
    }

    public ExamineListResult() {}

    protected ExamineListResult(Parcel in) {
        this.id = in.readString();
        this.gname = in.readString();
        this.sorting = in.readString();
        this.examine_list = in.createTypedArrayList(ExListEntity.CREATOR);
    }

    public static final Creator<ExamineListResult> CREATOR = new Creator<ExamineListResult>() {
        @Override
        public ExamineListResult createFromParcel(Parcel source) {return new ExamineListResult(source);}

        @Override
        public ExamineListResult[] newArray(int size) {return new ExamineListResult[size];}
    };
}
